package com.zbkj.service.service.impl.splittingAccount;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zbkj.common.model.shop.BusinessApply;
import com.zbkj.service.dao.shop.BusinessApplyDao;
import com.zbkj.service.service.BusinessApplyService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Slf4j
@Service
@RequiredArgsConstructor
public class BusinessApplyServiceImpl extends ServiceImpl<BusinessApplyDao, BusinessApply>
        implements BusinessApplyService {

    @Override
    @DS("pointarchive")
    public BusinessApply getMerType(Long userId, Integer merType) {
        BusinessApply businessApply = this.getOne(new QueryWrapper<BusinessApply>()
                .lambda()
                .eq(BusinessApply::getUserId, userId).eq(BusinessApply::getRegisterType, merType)
                .eq(BusinessApply::getDelFlag, "0")
                .eq(BusinessApply::getStatus, "30")
                .last("limit 1")

        );
        return businessApply;
    }
}
